﻿<Window x:Class="wpf.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:wpf"
    Title="Sonority" Height="382" Width="776">
  <Window.Resources>
    <SolidColorBrush x:Key="SolidBorderBrush" Color="#888" />
    <LinearGradientBrush x:Key="PressedBrush" StartPoint="0,0" EndPoint="0,1">
      <GradientBrush.GradientStops>
        <GradientStopCollection>
          <GradientStop Color="#BBB" Offset="0.0"/>
          <GradientStop Color="#EEE" Offset="0.1"/>
          <GradientStop Color="#EEE" Offset="0.9"/>
          <GradientStop Color="#FFF" Offset="1.0"/>
        </GradientStopCollection>
      </GradientBrush.GradientStops>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="DarkBrush" StartPoint="0,0" EndPoint="0,1">
      <GradientBrush.GradientStops>
        <GradientStopCollection>
          <GradientStop Color="#FFF" Offset="0.0"/>
          <GradientStop Color="#AAA" Offset="1.0"/>
        </GradientStopCollection>
      </GradientBrush.GradientStops>
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="NormalBorderBrush" StartPoint="0,0" EndPoint="0,1">
      <GradientBrush.GradientStops>
        <GradientStopCollection>
          <GradientStop Color="#CCC" Offset="0.0"/>
          <GradientStop Color="#444" Offset="1.0"/>
        </GradientStopCollection>
      </GradientBrush.GradientStops>
    </LinearGradientBrush>
    <Style x:Key="{x:Type ProgressBar}"
         TargetType="{x:Type ProgressBar}">
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type ProgressBar}">
            <Grid MinHeight="14" MinWidth="100">
              <Border
                Name="PART_Track"
                CornerRadius="2"
                Background="{StaticResource PressedBrush}"
                BorderBrush="{StaticResource SolidBorderBrush}"
                BorderThickness="1" />
              <Border
                Name="PART_Indicator"
                CornerRadius="2"
                Background="{StaticResource DarkBrush}"
                BorderBrush="{StaticResource NormalBorderBrush}"
                BorderThickness="1"
                HorizontalAlignment="Left" />
            </Grid>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
  </Window.Resources>
  <DockPanel>
    <TabControl Name="tabControl1" DockPanel.Dock="Left" TabStripPlacement="Left" ItemsSource="{Binding Path=Discover.Topology, Source={x:Static Application.Current}, IsAsync=True}">
      <TabControl.ContentTemplate>
        <DataTemplate>
          <local:QueueControl DataContext="{Binding IsAsync=True}" />
        </DataTemplate>
      </TabControl.ContentTemplate>
      <TabControl.ItemTemplate>
        <DataTemplate>
          <local:SonosControl DockPanel.Dock="Left" DataContext="{Binding IsAsync=True}"/>
        </DataTemplate>
      </TabControl.ItemTemplate>
      <TabControl.InputBindings>
        <KeyBinding Key="F" Modifiers="Control" Command="MediaCommands.NextTrack"/>
        <KeyBinding Key="B" Modifiers="Control" Command="MediaCommands.PreviousTrack"/>
        <KeyBinding Key="P" Modifiers="Control" Command="MediaCommands.TogglePlayPause"/>
        <KeyBinding Key="MediaNextTrack" Command="MediaCommands.NextTrack" />
        <KeyBinding Key="MediaPreviousTrack" Command="MediaCommands.PreviousTrack"/>
        <KeyBinding Key="MediaStop" Command="MediaCommands.Stop"/>
        <KeyBinding Key="MediaPlayPause" Command="MediaCommands.TogglePlayPause"/>
        <KeyBinding Key="VolumeMute" Command="MediaCommands.MuteVolume"/>
        <KeyBinding Key="VolumeUp" Command="MediaCommands.IncreaseVolume"/>
        <KeyBinding Key="VolumeDown" Command="MediaCommands.DecreaseVolume"/>
        <KeyBinding Key="F10" Command="MediaCommands.IncreaseVolume"/>
        <KeyBinding Key="F9" Command="MediaCommands.DecreaseVolume" />
        <KeyBinding Key="Return" Command="MediaCommands.Select" />
        <KeyBinding Key="Delete" Command="ApplicationCommands.Delete"/>
        <MouseBinding MouseAction="LeftDoubleClick" Command="MediaCommands.Select" />
      </TabControl.InputBindings>
    </TabControl>
    <TreeView DockPanel.Dock="Right" ItemsSource="{Binding Path=Coordinator.Library}"/>
  </DockPanel>
</Window>
